package exo1;

/**
 * Created with IntelliJ IDEA.
 * User: naberrad
 * Date: 14/10/13
 * Time: 14:08
 * To change this template use File | Settings | File Templates.
 */
public class Cone extends Shape3D {

    private double height;
    private double radius;

    public Cone(double height, double radius) {
        this.height = height;
        this.radius = radius;
    }

    public double getHeight() {
        return height;
    }

    public double getRadius() {
        return radius;
    }


    @Override
    public double volume() {

        double v=Math.PI/3*Math.pow(radius,2)*height;
        return v;
    }

    @Override
    public double surface() {
        double s=Math.PI*radius*Math.sqrt(Math.pow(radius,2)+Math.pow(height,2));
        return s;
    }

}
